@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-10 col-md-offset-1">
            <div class="panel panel-default">
                <div class="panel-heading">用户列表</div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <td>邮箱</td>
                                <td>用户</td>
                                <td>注册时间</td>
                                <td>角色</td>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach ($users as $user)
                            <tr>
                                <td>{{ $user->email }}</td>
                                <td><a href="/user/{{ $user->id }}/profile">{{ $user->name }}</a></td>
                                <td>{{ $user->created_at }}</td>
                                <td class="text-center">
                                    @foreach ($role as $user->roles)
                                    {{ $role->name }} |
                                    @endforeach
                                </td>
                            </tr>
                            @endforeach
                            </tbody>
                        </table>
                    </div>
                    <div class="pull-right">
                    {!!$users->render()!!}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection